#include "control.h"

MotorControl_t Motor_horiz;
MotorControl_t Motor_Verti;

void MotorSpeedInit(float kp,float ki,float kd){
    //电机初始化
  moto_init(&Motor_horiz.Motor, MOTOR_HORIZONTAL_MOVE);
  moto_init(&Motor_Verti.Motor, MOTOR_VERTICAL_MOVE);

  PID_Init_Config_s config={.Kp=kp,.Ki=ki,.Kd=kd,.MaxOut=15000,.DeadBand=0,.IntegralLimit=500,.Intergral_Separate=10,
    .Improve=PID_DeltaT_Limit|PID_Integral_Limit|PID_Integral_Separate,.DeltaT_Limit_Min=0,.DeltaT_Limit_Max=0.05};
  PIDInit(&Motor_horiz.Motor_pid, &config);
  PIDInit(&Motor_Verti.Motor_pid, &config);
  

}